"0","```r
# Shannon
pi.SCPD <- scpdSM/rowSums(scpdSM)
pi.SCPDxlogpi <- pi.SCPD * log(pi.SCPD)
sums_shan <- rowSums(pi.SCPDxlogpi, na.rm=T)
H_calc <- -sums_shan
all(H==H_calc)
```"
"1","[1] TRUE
"
"0","```r
# Simpson
pi.SCPD2 <- pi.SCPD^2
sums_simp <- rowSums(pi.SCPD2, na.rm=T)
Simp_calc <- 1-sums_simp
all(Simp==Simp_calc)
```"
"1","[1] TRUE
"
